﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ProductByParent.ascx.cs" Inherits="webapp4U.UI.Controls.Product" %>
<%@ Import Namespace="webapp4U" %>

<table align="center" width="500px" border="0">
    <tr>
        <td>
            <asp:Repeater runat="server" ID="rptCategory">
            <ItemTemplate>
                <tr>
                    <td style="font-weight:bold; padding-top:5pt; padding-left:18px;" class="Title">
                        <img src="<%=Globals.ImagesUrl()%>/l.gif" border="0" align="absmiddle"><%# (Globals.LangVietNam())? Eval("CateName") : Eval("CateName_en")%>
                    </td>
                </tr>
                <tr>
                    <td align="center">
                         <!-- Begin San Pham -->
                          <asp:DataList ID="ItemsDataList" runat="server" Width="100%" 
                          RepeatDirection="Horizontal" 
                          EnableViewState="False" 
                          DataSource='<%# GetItemsByCateID((int) Eval("CateID")) %>' 
                          CellPadding="10" 
                          ItemStyle-HorizontalAlign="left"
                          RepeatColumns="3">
                           <ItemTemplate>
                            <table border="0" align="left" style="table-layout:fixed;">
                                <tr>
                                    <td class="BorderImage" width="140" height="140" align="center">
                                        <a href="ProductDetail.aspx?ProductID=<%#Eval("ProductID")%>">
                                            <img onmouseover="showtrail('<%=Globals.ApplicationPath %>Products/Image.ashx?Size=L&ImageUrl=<%# Eval("ImageUrl") %>','<%# Eval("Description")%>',500,500)" onmouseout="hidetrail();" border="0" src='<%=Globals.ApplicationPath %>Products/Image.ashx?Size=M&ImageUrl=<%# Eval("ImageUrl") %>' />                                 
                                        </a>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center" class="ProductPrice">
                                        <%=ResourceManager.GetString("Product_Price") %>: <%#GetPrice((Decimal)Eval("UnitPrice")) %>
                                    </td>
                                </tr>
                                <tr height="40">
                                    <td align="center" style="font-weight:bold; color:#5ed3f6">
                                        <a class="ProductName" href="ProductDetail.aspx?ProductID=<%#Eval("ProductID")%>"><%# Eval("Title")%></a>
                                    </td>
                                </tr>
                               <%-- <tr>
                                    <td align="center" height="20px;">
                                        <asp:Panel runat=server ID="PanelAddToCart">
                                            <a href="<%=Globals.ApplicationPath %>Products/ShoppingCart.aspx?ProductID=<%#Eval("ProductID")%>&Action=AddToCart">
                                                <%#GetButtonAddToCart((Decimal)Eval("UnitPrice")) %>
                                            </a>
                                        </asp:Panel>
                                    </td>
                                </tr>--%>
                            </table>
                        </ItemTemplate>
                          </asp:DataList>
                        <!-- End San Pham -->
                    </td>
                </tr>
                <tr>
                    <td align="right" style="padding-right: 20px; padding-bottom:3px;">
                        <img src="<%=Globals.ImagesUrl()%>arrow.gif" />
                        <a class="ReadMore" href="<%=Globals.ApplicationPath%>Products/Product.aspx?CateID=<%# Eval("CateID")%>">
                                <%=ResourceManager.GetString("ReadMore") %>
                        </a>
                    </td>
                </tr>
                <tr><td style="background-repeat:repeat-x; padding:3pt;" background="<%=Globals.ImagesUrl()%>pm_line.gif"></td></tr>
            </ItemTemplate>
            </asp:Repeater>
        </td>
    </tr>
</table>
